{% extends 'layout/manage.html' %}
{% block title %}管理中心{% endblock %}
{% block css %}
    <style>
        .project {
            margin-top: 60px;
        }

        .panel-body {
            padding: 0;
            display: flex;
            flex-direction: row;
            justify-content: left;
            align-items: flex-start;
            flex-wrap: wrap;
        }

        .panel-body > .item {
            border-radius: 6px;
            width: 228px;
            border: 1px solid #dddddd;
            margin: 20px 10px;

        }

        .panel-body > .item:hover {
            border: 1px solid #f0ad4e;
        }

        .panel-body > .item > .title {
            height: 104px;
            color: white;
            display: flex;
            justify-content: center;
            align-items: center;
            border-top-left-radius: 6px;
            border-top-right-radius: 6px;
            font-size: 15px;
            text-decoration: none;
        }

        .panel-body > .item > .info {
            padding: 10px 10px;

            display: flex;
            justify-content: space-between;

            border-bottom-left-radius: 6px;
            border-bottom-right-radius: 6px;
            color: #8c8c8c;

        }

        .panel-body > .item > .info a {
            text-decoration: none;
        }

        .panel-body > .item > .info .fa-star {
            font-size: 18px;
        }

        .color-radio label {
            margin-left: 0;
            padding-left: 0;
        }

        .color-radio input[type="radio"] {
            display: none;
        }

        .color-radio input[type="radio"] + .cycle {
            display: inline-block;
            height: 25px;
            width: 25px;
            border-radius: 50%;
            border: 2px solid #dddddd;
        }

        .color-radio input[type="radio"]:checked + .cycle {
            border: 2px solid black;
        }
    </style>
{% endblock %}
{% block content %}
    <div class="container-fluid project">
        <div class="panel panel-default">
            <div class="panel-heading">
                <i class="fa fa-star" aria-hidden="true">星标项目</i>
            </div>
            <div class="panel-body">
                {% for i in project_dict.star %}
                    <div class="item">
                        <a href="{% url 'dashboard' project_id=i.value.id %}" class="title"
                           style="background-color: {{ i.value.get_color_display }};">{{ i.value.project_name }}</a>
                        <div class="info">
                            <div>
                                <a href="{% url 'project_unstar' project_type=i.type project_id=i.value.id %}">
                                    <i class="fa fa-star" aria-hidden="true" style="color: #f0ad4e;"></i>
                                </a>
                                <span>{{ i.value.create_user.user_name }}</span>
                            </div>
                            <div>
                                <i class="fa fa-user-o" aria-hidden="true"></i>
                                <span>{{ i.value.participators }}</span>
                            </div>
                        </div>
                    </div>
                {% endfor %}
            </div>
            {#        <div class="panel-footer">Panel footer</div>#}
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">
                <i class="fa fa-list" aria-hidden="true">我创建的项目</i>
            </div>
            <div class="panel-body">
                {% for i in project_dict.my %}
                    <div class="item">
                        <a href="{% url 'dashboard' project_id=i.id %}" class="title"
                           style="background-color: {{ i.get_color_display }};">{{ i.project_name }}</a>
                        <div class="info">
                            <div>
                                <a href="{% url 'project_star' project_type='my' project_id=i.id %}">
                                    <i class="fa fa-star" aria-hidden="true" style="color: #d5d5d5;"></i>
                                </a>
                                <span>{{ i.create_user.user_name }}</span>
                            </div>
                            <div>
                                <i class="fa fa-user-o" aria-hidden="true"></i>
                                <span>{{ i.participators }}</span>
                            </div>
                        </div>
                    </div>
                {% endfor %}
            </div>
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">
                <i class="fa fa-link" aria-hidden="true">我参与的项目</i>
            </div>
            <div class="panel-body">
                {% for i in project_dict.join %}
                    <div class="item">
                        <a href="{% url 'dashboard' project_id=i.id %}" class="title"
                           style="background-color: {{ i.get_color_display }};">{{ i.project_name }}</a>
                        <div class="info">
                            <div>
                                <a href="{% url 'project_star' project_type='join' project_id=i.id %}">
                                    <i class="fa fa-star" aria-hidden="true" {% if i.star_flag %}
                                       style="color: #f0ad4e;" {% else %} style="color: #d5d5d5;"{% endif %}></i>
                                </a>
                                <span>{{ i.create_user.user_name }}</span>
                            </div>
                            <div>
                                <i class="fa fa-user-o" aria-hidden="true"></i>
                                <span>{{ i.participators }}</span>
                            </div>
                        </div>
                    </div>
                {% endfor %}
            </div>
        </div>
    </div>
{% endblock %}
